import { createRouter, createWebHistory } from "vue-router";
import Login from "../components/Login.vue";
import User from "../components/user.vue";
import PoemContent from "../components/shiwen/PoemContent.vue";
import PoemHome from "../components/shiwen/PoemHome.vue";
import Mobile from "../components/shiwen/Mobile.vue";

import Class from "../components/poemClass/class.vue";
import Info from "../components/userInfo.vue";
import Vedio from "../components/poemClass/vedio.vue";
import Forum from "../components/forum/Forum";
import TingShi from "../components/shiyin/tingshi.vue";
export const constantRoutes = [
  {
    path: "/",
    name: "Login",
    component: Login,
  },
  {
    path: "/user",
    name: "User",
    component: User,
    children: [
      {
        path: "/poem",
        name: "PoemHome",
        component: PoemHome,
      },
      {
        path: "/poemcontent/:title/:author/:theme",
        name: "PoemContent",
        component: PoemContent,
      },
      {
        path: "/mobile",
        name: "Mobile",
        component: Mobile,
      },
      { path: "/class", name: "Class", component: Class },
      {
        path: "/shiyin",
        name: "shiyin",
        component: TingShi,
      },
      {
        path: "/info",
        name: "Info",
        component: Info,
      },
      {
        path: "/vedio",
        name: "Vedio",
        component: Vedio,
      },
      {
        path: "/forum",
        name: "Forum",
        component: Forum,
      },
    ],
  },
];

export const router = createRouter({
  history: createWebHistory(),
  routes: constantRoutes,
});

export default router;
